package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_购买申请文件 实体类。
 *
 * @author 11987
 * @since 2025-07-01
 */
@Table(value = "LINDI_PURCHASE_APPLICATION_FILE", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiPurchaseApplicationFile extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 购买申请ID
     */
    private Long purchaseApplicationId;

    /**
     * 文件ID
     */
    private Long fileId;

    /**
     * 文件类型
     */
    private String fileType;

    // 构造函数
    public LindiPurchaseApplicationFile(){
    }

    public LindiPurchaseApplicationFile(Long purchaseApplicationId, Long fileId){
        this.purchaseApplicationId = purchaseApplicationId;
        this.fileId = fileId;
    }

    public LindiPurchaseApplicationFile(Long purchaseApplicationId, Long fileId, String fileType){
        this.purchaseApplicationId = purchaseApplicationId;
        this.fileId = fileId;
        this.fileType = fileType;
    }

    // Getter和Setter方法
    public Long getPurchaseApplicationId(){
        return purchaseApplicationId;
    }

    public void setPurchaseApplicationId(Long purchaseApplicationId){
        this.purchaseApplicationId = purchaseApplicationId;
    }

    public Long getFileId(){
        return fileId;
    }

    public void setFileId(Long fileId){
        this.fileId = fileId;
    }

    public String getFileType(){
        return fileType;
    }

    public void setFileType(String fileType){
        this.fileType = fileType;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiPurchaseApplicationFile that = (LindiPurchaseApplicationFile) o;
        return Objects.equals(purchaseApplicationId, that.purchaseApplicationId) &&
                Objects.equals(fileId, that.fileId) &&
                Objects.equals(fileType, that.fileType);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), purchaseApplicationId, fileId, fileType);
    }

    @Override
    public String toString(){
        return "LindiPurchaseApplicationFile{" +
                "purchaseApplicationId=" + purchaseApplicationId +
                ", fileId=" + fileId +
                ", fileType='" + fileType + '\'' +
                '}';
    }

    // Builder模式
    public static Builder builder(){
        return new Builder();
    }

    public static class Builder{
        private Long purchaseApplicationId;
        private Long fileId;
        private String fileType;

        public Builder purchaseApplicationId(Long purchaseApplicationId){
            this.purchaseApplicationId = purchaseApplicationId;
            return this;
        }

        public Builder fileId(Long fileId){
            this.fileId = fileId;
            return this;
        }

        public Builder fileType(String fileType){
            this.fileType = fileType;
            return this;
        }

        public LindiPurchaseApplicationFile build(){
            return new LindiPurchaseApplicationFile(purchaseApplicationId, fileId, fileType);
        }
    }

}
